# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kcontacts
pkgver=5.72.0
pkgrel=0
pkgdesc="Address book API for KDE"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.0-or-later"
depends="iso-codes"
depends_dev="qt5-qtbase-dev kcoreaddons-dev ki18n-dev kconfig-dev kcodecs-dev"
makedepends="$depends_dev extra-cmake-modules doxygen graphviz qt5-qttools-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcontacts-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="00a6331db40c315ae503dc84ddbf1a14e729925ab69f387d11ffa2669108ffa03d0494513d419f5006d4e99cff244acf519fd7f40311cc3e73995d8d029cd2e9  kcontacts-5.72.0.tar.xz"
